package com.fkcai.hansoul.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fkcai.hansoul.model.entity.PostComment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PostCommentMapper extends BaseMapper<PostComment> {
	/**
	 * 根据帖子 id 查询评论
	 *
	 * @param postId 帖子 id
	 * @return 评论列表
	 */
	@Select("SELECT * FROM post_comment WHERE post_id = #{postId} ORDER BY create_time DESC ")
	List<PostComment> selectByPostId (@Param("postId") Integer postId);
	
}
